package com.jz.community.moduleshoppingguide.search.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jz.community.moduleshoppingguide.R;

import java.util.List;

/**
 * Created by Tony.Fan on 2018/6/1 16:09
 */
public class SearchHotWordAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public SearchHotWordAdapter(int layoutResId, @Nullable List<String> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        helper.setText(R.id.item_search_near_tv, item);

        ImageView line = helper.getView(R.id.item_search_near_line);

        //添加分割线
        if (helper.getAdapterPosition() != mData.size() - 1) {
            line.setVisibility(View.VISIBLE);
        } else {
            line.setVisibility(View.GONE);
        }
    }
}
